package com.leetcode_Onequestion;

public class leetcode_357 {
    public static void main(String[] args) {
        for (int i = 0; i < 10; i++) {

            System.out.println(solution(i));
        }
    }
    public static int solution(int n){
        if (n == 0)
            return 0;
        if( n == 1)
            return 9;
        int res = 10;
        int cur = 9;
        for (int i = 0; i < n-1; i++) {
            cur *= 9-i;
            res += cur;
        }
        return res;
    }
}
